fix(server): keep older clients connected after keybinding additions - #5018
fix(server): keep older clients connected after keybinding additions#5018PixPMusic wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This backwards-compatibility fix modifies what keybindings are sent to websocket clients based on version negotiation. While the change is well-scoped and thoroughly tested, it touches core server-client communication in ws.ts and the author is not a frequent contributor to this file, warranting human verification. You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate 8785f3d
|
Confirmed this exact regression against production T3 Connect. With Nightly |
|
this feels like the wrong solution to the problem |
|
@juliusmarminge main concern was keeping the nightly server compatible with the released mobile client, as App Store review time can take a while. If you don't care about nightlies being compatible--or want to start doing CI nightlies for Android at least?--then we can move in another direction. |
|
I do care about nightlies being compatible, but we've already submitted a new version for review and I'm not sure if we can do a new OTA right now ( I think build versions are in a rough state...) so we should just fix it properly |
What Changed
filePicker.toggleandprojectSearch.toggleout of config and mutation responses for clients that predate the negotiation.Why
Nightly
0.0.32-nightly.20260730.957began returning two new default keybinding commands. The0.0.31client validates those commands against a closed schema while establishing its connection, so it rejects the initial server config and never reaches the connected state.Current clients now advertise support through the WebSocket URL. Older clients omit the capability and receive a legacy-safe wire projection without changing the persisted or in-memory keybinding configuration. Older servers ignore the additional query parameter.
Verification
vp test run packages/client-runtime/src/rpc/session.test.ts apps/server/src/server.test.ts— 121 tests passedvp run --filter @t3tools/contracts --filter @t3tools/client-runtime --filter t3 typecheckgit diff --check origin/main...HEADChecklist
Model: GPT-5.6 Sol | Harness: Codex in T3 Code
Note
Medium Risk
Wire compatibility logic on the hot WebSocket path; mistakes could hide keybindings from current clients or still break legacy connects, but scope is limited to response projection with strong test coverage.
Overview
Adds WebSocket keybinding command-set negotiation so nightly servers can expose
filePicker.toggleandprojectSearch.togglewithout breaking 0.0.31 clients that validate keybindings against a smaller schema during connect.Contracts define
WS_KEYBINDING_COMMAND_SET_QUERY_PARAMandCURRENT_KEYBINDING_COMMAND_SET_VERSION. Client runtime appends that query param when opening the WebSocket. Server reads it on/wsupgrade and, for connections without a current version, filters those two commands from keybinding payloads onserverGetConfig, upsert/remove responses, andsubscribeServerConfigstreams—without changing persisted config.Regression tests cover unnegotiated, legacy (
0), current, and future client versions across config, streams, and mutations.Reviewed by Cursor Bugbot for commit 8785f3d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Filter keybinding commands for older clients after new keybinding additions
WS_KEYBINDING_COMMAND_SET_QUERY_PARAMandCURRENT_KEYBINDING_COMMAND_SET_VERSION(1) to rpc.ts as a versioning mechanism for keybinding command sets.keybindingCommandSet=<version>to the WebSocket URL in session.ts.filePicker.toggleandprojectSearch.togglefrom keybindings inserverGetConfig,serverUpsertKeybinding,serverRemoveKeybinding, andsubscribeServerConfigresponses.Macroscope summarized 8785f3d.